package com.gitee.wsl.func.expression.visitor

import com.gitee.wsl.func.expression.ComposedExpression
import com.gitee.wsl.reflect.func.call.FunctionCall
import com.gitee.wsl.reflect.func.value.DynamicValue
import com.gitee.wsl.reflect.func.value.GeneralCollectionValue
import com.gitee.wsl.reflect.func.value.NoneValue
import com.gitee.wsl.reflect.func.value.PairValue
import com.gitee.wsl.reflect.func.value.Value


/**
 * A visitor for different kinds of [Expression].
 * @param T output type of the `visit` methods
 * @see Expression
 * @see EvalExpressionVisitor
 * @see AppendExpressionVisitor
 */
interface ExpressionVisitor<T> {

    fun visit(value: GeneralCollectionValue<*>): T

    fun visit(value: PairValue<*, *>): T

    fun visit(value: Value<*>): T

    fun visit(value: DynamicValue): T

    fun visit(value: NoneValue): T

    fun visit(expression: FunctionCall<*>): T

    fun visit(expression: ComposedExpression): T
}
